/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ccedeno
 */
@Embeddable
public class CorrDocAreaPK implements Serializable {

    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 11)
    @Column(name = "id_corr_doc_area", nullable = false, length = 11)
    private String idCorrDocArea;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "fk_area", nullable = false, length = 3)
    private String fkArea;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "fk_tip_doc", nullable = false, length = 3)
    private String fkTipDoc;

    public CorrDocAreaPK() {
    }

    public CorrDocAreaPK(String idCorrDocArea, String fkArea, String fkTipDoc) {
        this.idCorrDocArea = idCorrDocArea;
        this.fkArea = fkArea;
        this.fkTipDoc = fkTipDoc;
    }

    public String getIdCorrDocArea() {
        return idCorrDocArea;
    }

    public void setIdCorrDocArea(String idCorrDocArea) {
        this.idCorrDocArea = idCorrDocArea;
    }

    public String getFkArea() {
        return fkArea;
    }

    public void setFkArea(String fkArea) {
        this.fkArea = fkArea;
    }

    public String getFkTipDoc() {
        return fkTipDoc;
    }

    public void setFkTipDoc(String fkTipDoc) {
        this.fkTipDoc = fkTipDoc;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCorrDocArea != null ? idCorrDocArea.hashCode() : 0);
        hash += (fkArea != null ? fkArea.hashCode() : 0);
        hash += (fkTipDoc != null ? fkTipDoc.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CorrDocAreaPK)) {
            return false;
        }
        CorrDocAreaPK other = (CorrDocAreaPK) object;
        if ((this.idCorrDocArea == null && other.idCorrDocArea != null) || (this.idCorrDocArea != null && !this.idCorrDocArea.equals(other.idCorrDocArea))) {
            return false;
        }
        if ((this.fkArea == null && other.fkArea != null) || (this.fkArea != null && !this.fkArea.equals(other.fkArea))) {
            return false;
        }
        if ((this.fkTipDoc == null && other.fkTipDoc != null) || (this.fkTipDoc != null && !this.fkTipDoc.equals(other.fkTipDoc))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.CorrDocAreaPK[ idCorrDocArea=" + idCorrDocArea + ", fkArea=" + fkArea + ", fkTipDoc=" + fkTipDoc + " ]";
    }
}
